package com.com.hefei.wdp.example.service;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;



@EnableBinding(Source.class) // 定义消息推送管道
public class IMessageProducerImpl implements IMessageProducer{
    @Autowired
    private Source source;
//    @Autowired @Qualifier(Source.OUTPUT)
//    private MessageChannel output;//消息发送通道

    @Override
    public String seand() {
        source.output().send(MessageBuilder.withPayload("hello").build());
        return null;
    }
}
